//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>

#include "CheckPatternInFastaFile.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
using namespace std;
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
int main (int argc, char** argv) {
  
  CheckPatternInFastaFile* checkPatternInFastaFile = NULL;
  
  if (argc < 4) {
    
    cout << "Error in the input parameters! Must by like: " << endl;
    cout << "./IdentifySequenceWithPatterns <Namefile with sequence in FASTA format>";
    cout <<                               " <Namefile with Patterns list>";
    cout <<                               " <Namefile Out>";
    cout << endl;
    
    return EXIT_FAILURE;
    
  }
  else {
    
    checkPatternInFastaFile = new  CheckPatternInFastaFile ();
    
    checkPatternInFastaFile->FilenameFasta()->In(argv[1]);
    checkPatternInFastaFile->FilenamePatterns()->In(argv[2]);
    checkPatternInFastaFile->FilenameOut()->In(argv[3]);
    
    cout << "---------------------------------------------------------------------------------" << endl;
    cout << " Namefile with sequence in FASTA format : " << argv[1] << endl;
    cout << "            Namefile with Patterns list : " << argv[2] << endl;
    cout << "                           Namefile Out : " << argv[3] << endl;
    cout << "---------------------------------------------------------------------------------" << endl;
    
  }
  
  cout << "Loading Data..." << endl;
  if (!checkPatternInFastaFile->LoadData())
    cout << "Error loading Data..." << endl;
  
  cout << "Checking the sequence that contain the patterns..." << endl;
  if (!checkPatternInFastaFile->OutSequenceWithPatterns())
    cout << "Error checking the sequence that contain the patterns..." << endl;
  
  cout << "Finished..." << endl << "Good Bye" << endl;
  
  if (checkPatternInFastaFile) delete checkPatternInFastaFile;

  return EXIT_SUCCESS;
  
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//

